﻿using System.Collections;
using System.Collections.Generic;

using UnityEngine;
using UnityEngine.UI;
// 表示UI关联的内容
public class UIManager : MonoBehaviour {

    // public.
    // 状态文本
    public Text statusText;

    // Combo文本
    public Text comboText;

    // private.
    // Combo数
    private int comboCount = 0;

    //-------------------------------------------------------
    // Public Function
    //-------------------------------------------------------
    public void SetStatusText (string status) {
        statusText.text = status;
    }

    public void ResetCombo ( ) {
        comboCount = 0;
        UpdateComboText ( );
    }

    public void AddCombo ( ) {
        comboCount++;
        UpdateComboText ( );
    }

    //-------------------------------------------------------
    // Private Function
    //-------------------------------------------------------
    private void UpdateComboText ( ) {
        comboText.text = string.Format ("Combo{1}{0}", comboCount, ":");

        // java感觉是这么写的
        // string x = "{},{}";
        // x.Format("1","2");
        // 最后打印x输出的字符串就是【1,2】

        // C#的感觉
        // string x = "{0},{1}";
        // string.Format(x, "1","2");
        // 最后打印x输出的字符串就是【1,2】

    }

}